// pages/shixun/stars/stars.js
Component({
    properties: {
        stars:{
            type:Number,
            value:0
        }
    },
    lifetimes:{
        attached(){
            console.log(this.data.stars)
            let light ='a'.repeat (Math.floor(this.data.stars/2))
            let half =this.data.stars % 2 !=0
            let block ='a'.repeat (Math.floor((10-this.data.stars)/2))
            let text= this.data.stars && this.data.stars>0? this.data.stars.toFixed(1):"未评分"
            this.setData({
                light,half,block,text
            })
            console.log(light,half,block,text)
        }
    },
        
})